let utils = require('../../../utils/utils.js')
const app = getApp()

Page({

    /**
     * Page initial data
     */
    data: {
        bleInfo: app.globalData.bleInfo
    },

    /**
     * 生命周期函数--监听页面加载
     * 向蓝牙发送0info命令获取设备信息
     */
    onLoad: function (options) {
        let connectingDeviceId = options.deviceId;
        let services_UUID = options.serviceId;
        let characteristic_UUID = options.characteristicId;
        console.log("[info]: ", connectingDeviceId, services_UUID, characteristic_UUID);
        let info = '0info';
        utils.writeToBluetoothValue(connectingDeviceId, services_UUID, characteristic_UUID, info);
    },

    /**
     * 设备文件管理
     */
    manageSpace() {
        wx.navigateTo({
            url: '/pages/device/space/space',
        })
    },
})